package util.wikiXML.objectModel;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class WikiPage {

	/**
	 * @param args
	 */
	public List section = new LinkedList();
	// public LinkedList categories;
	public List<WikiLink> cross_lingual = new LinkedList<WikiLink>();
	
	//list of links 
	public List<WikiLink> links = new LinkedList<WikiLink>();
	public List categories = new LinkedList();
	
	
	
	
	
	private String title;
	private String name;
	private String namespace;

	public String getNamespace() {
		return namespace;
	}

	public void setNamespace(String namespace) {
		this.namespace = namespace;
	}

	private String id;

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public WikiPage() {

	}

	public List getSection() {
		return section;
	}

	public List getCross_lingual() {
		return cross_lingual;
	}

	public void setCross_lingual(List cross_lingual) {
		this.cross_lingual = cross_lingual;
	}

	public void setSection(List section) {
		this.section = section;
	}

	public void addSection(WikiContainer container) {
		this.section.add(container);
	}

	public String getArticlenText() {

		StringBuffer string = new StringBuffer("");

		Iterator iterator = section.iterator();
		while (iterator.hasNext()) {

			Object obj = iterator.next();

			if (obj instanceof WikiParagraph) {
				WikiParagraph p = (WikiParagraph) obj;
				string.append(p.getText());

			}

		}

		return string.toString();

	}
	
	
	

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
